<?php

error_reporting(E_ALL);

/**
 * reloj-checador - class.conecction.php
 *
 * $Id$
 *
 * This file is part of reloj-checador.
 *
 * Automatically generated on 22.08.2013, 19:51:48 with ArgoUML PHP module 
 * (last revised $Date: 2010-01-12 20:14:42 +0100 (Tue, 12 Jan 2010) $)
 *
 * @author firstname and lastname of author, <author@example.org>
 */

if (0 > version_compare(PHP_VERSION, '5')) {
    die('This file was generated for PHP 5');
}

/* user defined includes */
// section -64--88-0-101-81690f7:140a816daa7:-8000:000000000000097D-includes begin
// section -64--88-0-101-81690f7:140a816daa7:-8000:000000000000097D-includes end

/* user defined constants */
// section -64--88-0-101-81690f7:140a816daa7:-8000:000000000000097D-constants begin
// section -64--88-0-101-81690f7:140a816daa7:-8000:000000000000097D-constants end

/**
 * Short description of class conecction
 *
 * @access public
 * @author firstname and lastname of author, <author@example.org>
 */
class conexion
{
    // --- ASSOCIATIONS ---


    // --- ATTRIBUTES ---

    /**
     * Short description of attribute host
     *
     * @access public
     */
    public $host = 'localhost';

    /**
     * Short description of attribute pass
     *
     * @access public
     */
    public $pass = '2527';

    /**
     * Short description of attribute user_mysql
     *
     * @access public
     */
    public $user_mysql='root';

    /**
     * Short description of attribute database
     *
     * @access public
     */
    public $database = 'reloi_checador';

    // --- OPERATIONS ---

    /**
     * Short description of method abrir
     *
     * @access public
     * @author firstname and lastname of author, <author@example.org>
     * @return mixed
     */
    
    public $cnn;
    public function abrir()
    {
        // section -64--88-0-101-81690f7:140a816daa7:-8000:000000000000097E begin
        $this->cnn = mysql_connect($this->host,$this->user_mysql, $this->pass);
    	mysql_select_db($this->database);
        // section -64--88-0-101-81690f7:140a816daa7:-8000:000000000000097E end
    }

    /**
     * Short description of method cerrar
     *
     * @access public
     * @author firstname and lastname of author, <author@example.org>
     * @return mixed
     */
    public function cerrar()
    {
        // section -64--88-0-101-81690f7:140a816daa7:-8000:000000000000098C begin
        mysql_close($this->cnn);
        // section -64--88-0-101-81690f7:140a816daa7:-8000:000000000000098C end
    }

    /**
     * Short description of method ejecutar
     *
     * @access public
     * @author firstname and lastname of author, <author@example.org>
     * @return mixed
     */
    public function ejecutar($query)
    {
        // section -64--88-0-101-81690f7:140a816daa7:-8000:000000000000098E begin
       	$this->abrir();
       	$result = mysql_query($query);
        echo mysql_error();
        $this->cerrar();
        return $result;
        
        // section -64--88-0-101-81690f7:140a816daa7:-8000:000000000000098E end
    }

} /* end of class conecction */

?>